//const controllers = require('../../controllers/controllerIndex.js').controller;
const app = getApp();
const controllers = app.controllers;
Page({
  data: {
    dataList:[],
  },
  onLoad: function (options) {
    this.getList();
  },
  getList: function () {
    let searchKey = this.data.searchKey||"";
    let that = this; 
      controllers.checkVIPlist({
        sessionId: wx.getStorageSync('token'),
        shopId:wx.getStorageSync('shopId'),
        mobile: searchKey
      }).then(res =>{
        that.setData({
          dataList:res.data
         });
      });
  },
  openCard() {
    wx.navigateTo({
      url: '../OpenCard/OpenCard',
    })
  },
  
  searchInput: function (e) {//搜索输入框
    this.setData({
      searchKey:e.detail.value
    });
  },
  onSearch: function (e) {//搜索
    this.getList();
  }, 
  toUrl(e) {
    var d = e.currentTarget.dataset;
    let url = d.url;
    console.info(url);
    wx.navigateTo({
      url: url
    });
  },

})